package moon.core.entity;

import moon.core.Name;
import moon.core.classdef.ClassDef;
import moon.core.classdef.Type;

/** 
 * Predefined entity, it represents the current object.
 * 
 * @author <a href="mailto:rmartico@ubu.es">Ra&uacute;l Marticorena</a>
 * @since JavaMoon-1.3
 */
@SuppressWarnings("serial")
public abstract class Self extends PredefinedEntity {
	
	/**
	 * Constructor.
	 * 
	 * @param name name
	 * @param type type
	 */
	public Self(Name name, Type type) {
		super(name, type);		
	}

    /**
     * Implements abstract method NamedObject.getUniqueName.
     * {@inheritDoc}
     * 
     * Name convention: nameSpaceName.className#self
     * 
     * @return {@inheritDoc}
     * @since JavaMoon-1.3.5
     * 
     * FIXME review
     */
	@Override
    public Name getUniqueName(){    
		assert this.getType()!=null;
		assert this.getType().getClassDef()!=null;
		assert this.getType().getClassDef().getUniqueName()!=null;
    	return  this.getType().getClassDef().getUniqueName().concat("#self");
    }
   
} // Self
